home *** CD-ROM | disk | FTP | other *** search
- Path: access1.digex.net!not-for-mail
- From: ell@access1.digex.net (Ell)
- Newsgroups: comp.lang.c++
- Subject: Re: novice question on copy constru
- Date: 16 Feb 1996 19:54:19 GMT
- Organization: The Universe
- Message-ID: <4g2ndb$4qh@news4.digex.net>
- References: <AL9SoXAZfTHxEwVN@mics.demon.co.uk> <4g0et8$3h6$2@mhadg.production.compuserve.com>
- NNTP-Posting-Host: access1.digex.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- John Puopolo (102262.612@CompuServe.COM) wrote:
- : It is recommended that you always supply:
- :
- : A ctor
- : A dtor (virtual if approp)
- : A copy ctor
- : An assignment (=) operator
- :
- : For every non-trivial class that you implement. Leave nothing to
- : chance and you'll have far fewer headaches. Been there... done
- : that.
-
- To add to this, the ctor, copy ctor, dtor, and op= are usually needed for
- classes with heap allocated members. The dtor should be virtual when
- deriving classes from a base class.
-
- Elliott
-